package com.thtf.openguess.controller;


import com.google.common.base.Stopwatch;
import com.thtf.openguess.aop.annotation.Time;
import com.thtf.openguess.openguess.C2016000000B20411;
import com.thtf.openguess.service.AsyncService;
import com.thtf.openguess.service.C2016000000B20411Service;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Update;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.configurationprocessor.json.JSONObject;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import uk.co.jemos.podam.api.PodamFactory;

import javax.annotation.Resource;
import java.util.UUID;
import java.util.concurrent.CountDownLatch;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author auth
 * @since 2022-05-27
 */
@Slf4j
@RestController
@Api(value = "c2016000000-b20411",tags = "c2016000000-b20411")
@RequestMapping("/openguess/c2016000000-b20411")
public class C2016000000B20411Controller {

    @Resource
    private C2016000000B20411Service service;

    @GetMapping("/insertLonely")
    @ApiOperation(value = "单线程循环新增",notes = "单线程循环新增")
    public String insertLonely(Integer sqlNum){
       return this.service.insertLonely(sqlNum);
    }

    @GetMapping("/insertBatch")
    @ApiOperation(value = "单线程批量新增",notes = "单线程批量新增")
    public String insertBatch(Integer sqlNum){
        return this.service.insertBatch(sqlNum);
    }

    @GetMapping("/insertThread")
    @ApiOperation(value = "多线程批量新增",notes = "多线程批量新增")
    public String insertThread(Integer sqlNum,Integer threadNum) throws InterruptedException {
        return this.service.insertThread(sqlNum,threadNum);
    }

    @GetMapping("/insertZzjgdm")
    @ApiOperation(value = "新增测试数据",notes = "新增测试数据")
    public String insertZzjgdm(Integer sqlNum,String zzjgdm){
        return this.service.insertZzjgdm(sqlNum,zzjgdm);
    }

    @GetMapping("/updateSingle")
    @ApiOperation(value = "单线程修改",notes = "单线程修改")
    public String update(String zzjgdm,Integer type){
        return this.service.updateSingle(zzjgdm,type);
    }

    @GetMapping("/updatebatch")
    @ApiOperation(value = "多线程修改",notes = "多线程修改")
    public String updatebatch(String zzjgdm,Integer type){
        return this.service.updatebatch(zzjgdm,type);
    }

    @GetMapping("/deleteSingle")
    @ApiOperation(value = "单线程删除",notes = "单线程删除")
    public String deleteSingle(String zzjgdm){
        return this.service.deleteSingle(zzjgdm);
    }

    @GetMapping("/deleteBatch")
    @ApiOperation(value = "多线程删除",notes = "多线程删除")
    public String deleteBatch(String zzjgdm){
        return this.service.deleteBatch(zzjgdm);
    }






}

